//创建路由
import { KeepAlive } from "vue";
import {createRouter, createWebHistory} from "vue-router";
const router = createRouter({
    //路由历史模式
    history:createWebHistory(),
    //路由映射列表
    routes: [
        {
            //路径
            path:'/',
            //路由组件
            component:()=> import('../view/HomeView.vue')
        },
        {
            //路径
            path:'/article',
            //路由组件
            component:()=> import('../view/ArticleView.vue')
        },
        {
            //路径
            path:'/writer',
            //路由组件
            component:()=> import('../view/WriterView.vue'),
            meta:{
                KeepAlive:true
            }
        },
        {
            //路径
            path:'/login',
            //路由组件
            component:()=> import('../view/LoginView.vue')
        }
    ]
})

export default router